package it.duecaffe.claysoftware.interventi.client.handler;

import it.duecaffe.claysoftware.interventi.shared.models.InterventoModel;

import com.google.gwt.event.shared.GwtEvent;

public class InserisciInterventoEvent extends GwtEvent<ClayEventHandler> {
	
	private InterventoModel intervento;
	private boolean confermaDefinitiva;
	
	public static Type<ClayEventHandler> TYPE = new Type<ClayEventHandler>();
	
	public InserisciInterventoEvent(InterventoModel intervento, boolean confermaDefinitiva) {
		this.intervento = intervento;
		this.confermaDefinitiva = confermaDefinitiva;
	}

	@Override
	public Type<ClayEventHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(ClayEventHandler handler) {
		handler.onInserisciIntervento(this);
	}
	
	public InterventoModel getIntervento() {
		return intervento;
	}
	
	public boolean getConfermaDefinitiva() {
		return confermaDefinitiva;
	}
}
